<template>
  <div class="home">
    <keep-alive include="find">
      <router-view></router-view>
    </keep-alive>
    <van-tabbar
      v-model="active"
      active-color="#4da4fb"
      inactive-color="#707070"
      class="tabbar"
      placeholder
      route
      v-if="$route.meta.needTab"
    >
      <van-tabbar-item to="/home/index">
        <span class="txt">首页</span>
        <template #icon>
          <i class="iconfont icon-rhome"></i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/home/search">
        <span class="txt">搜索</span>
        <template #icon>
          <i class="iconfont icon-search"></i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/home/video">
        <span class="txt">视频</span>
        <template #icon>
          <i class="iconfont icon-shipin"></i>
        </template>
      </van-tabbar-item>
      <van-tabbar-item to="/home/my">
        <span class="txt">我的</span>
        <template #icon>
          <i class="iconfont icon-wode"></i>
        </template>
      </van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
export default {
  data () {
    return {
      active: 3
    }
  }
}
</script>
<style lang="less" scoped>
.home {
  height: 100%;

  .tabbar {
    .iconfont {
      font-size: 29px;
    }
    .txt {
      font-size: 12px;
      font-family: PingFangSC, PingFangSC-Regular;
      font-weight: 400;
      text-align: center;
      line-height: 14px;
      letter-spacing: 0px;
    }
  }
}
</style>
